home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Burning & Media
/
GB-PVR 1.2.13
/
GBPVR10213.msi
/
Cabs.w1.cab
/
DetailDisplay.cs32
< prev
next >
Wrap
Text File
|
2007-09-08
|
5KB
|
127 lines
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using GBPVR.Public;
namespace gbweb.classes
{
public class DetailDisplay
{
public static string getDetailDisplay(Programme programme)
{
string programUniqueIdentifier = programme.getUniqueProgrammeIdentifier();
string description = programme.getDescription();
//Check to see if the user uses the ExtendedEWA Extended database
bool ExtendedEWAEnabled = ExtendedEWA.Initialize();
if (ExtendedEWAEnabled)
{
//Open the ExtendedEWA DB
ExtendedEWA.OpenExtendedEWADB();
}
//Add a line break if there is a description to provide seperation space
if (description.Length > 0)
{
description = description + "<br>";
}
//Retrieve the rating for the show
string rating = programme.getRating();
if (rating != null && rating != "")
{
description = description + "<br>" + " Rated: " + programme.getRating();
}
//Add the show Genre to the line
//set the label for the list of genre
ArrayList genreCheck = programme.getGenreList();
for (int unknownPos = genreCheck.BinarySearch("unknown", new CaseInsensitiveComparer()); unknownPos > -1;
unknownPos = genreCheck.BinarySearch("unknown", new CaseInsensitiveComparer()))
{
genreCheck.RemoveAt(unknownPos);
}
for (int unknownPos = genreCheck.BinarySearch(string.Empty, new CaseInsensitiveComparer()); unknownPos > -1;
unknownPos = genreCheck.BinarySearch(string.Empty, new CaseInsensitiveComparer()))
{
genreCheck.RemoveAt(unknownPos);
}
if (genreCheck.Count > 0)
{
description += "<br/>Genre" + (genreCheck.Count > 1 ? "s" : string.Empty) + ": " + string.Join(", ", (string[])genreCheck.ToArray(typeof(string)));
}
// If the user has ExtendedEWA append additional information to the description when found
if (ExtendedEWAEnabled)
{
// Pull the Airdate of the Show or the Release Year of the movie and the Start Rating for Movie
string[] programInfo = ExtendedEWA.GetProgramInfo(programUniqueIdentifier);
if (programInfo.Length > 0)
{
if (programUniqueIdentifier.StartsWith("MV"))
{
if (programInfo[0] != "0")
{
description += "<br> Movie Release Year: " + programInfo[0];
}
if (programInfo[2] != "none")
{
description += "<br> Star Rating: " + programInfo[2];
}
}
else
{
if (programInfo[1] != "none")
{
description += "<br> Original Air Date: " + programInfo[1];
}
}
}
//Check the ExtendedEWA supplemental database to see if the show is a new show
if (ExtendedEWA.IsNew(programUniqueIdentifier))
{
//If show is a new show tag an indicator at the end of the description indicating so
description += "<br><B> (* New *)</B>";
}
//We need to check to see if the airdate is >= to today since the New show identifier is not reliable.
//If the airdate is >= programme air date then we can assume it is a new show
else if (programInfo.Length > 0)
{
if (!programUniqueIdentifier.StartsWith("MV"))
{
if (programInfo[1] != "none")
{
try
{
DateTime airDate = Convert.ToDateTime(programInfo[1]);
if (airDate.Date >= programme.getStartTime().Date)
{
description += "<br><B> (* New *)</B>";
}
}
catch (Exception e)
{
}
}
}
}
//Close the ExtendedEWA DB
ExtendedEWA.CloseExtendedEWADB();
}
return description;
}
}
}